<extend name="Common/form-ajax" />
<block name="form">
	<tr>
		<th>名称:</th>
		<td>
			<input type="hidden" name="id" value="{$info.id}">
			<input type="text" name="title" datatype="require" tip="请填写配置中文名称" value="{$info.title}">
		</td>
	</tr>
	<tr>
		<th>标识:</th>
		<td>
			<input type="text" name="name" datatype="require" tip="请填写配置英文标志" value="{$info.name}">
		</td>
	</tr>
	<tr>
		<th>配置值类型:</th>
		<td>
			<select id="InputType" name="type" tip="请选择配置值的类型">
				<option value="1" <eq name="info.type" value="1">selected</eq> >字符串</option>
				<option value="2" <eq name="info.type" value="2">selected</eq> >长文本</option>
				<option value="3" <eq name="info.type" value="3">selected</eq> >数值</option>
				<option value="10" <eq name="info.type" value="10">selected</eq> >选择</option>
				<option value="9" <eq name="info.type" value="9">selected</eq> >开启关闭</option>
				<option value="11" <eq name="info.type" value="11">selected</eq> >数组参数</option>
			</select>
		</td>
	</tr>

	<tr id="InputExtra" <neq name="info.type" value="10">class="hide"</neq> >
		<th>选择参数:</th>
		<td>
			<textarea name="extra" rows="3" tip="选择参数以k:v,k:v为例">{$info.extra|default=""}</textarea>
		</td>
	</tr>
	
	<tr>
		<th>配置值:</th>
		<td>
			<textarea name="value" rows="3" datatype="require" tip="类型若为数组以k:v,k:v为例">{$info.value}</textarea>
		</td>
	</tr>
	<tr>
		<th>备注:</th>
		<td>
			<input type="text" name="remark" tip="配置的备注信息" value="{$info.remark}">
		</td>
	</tr>
	<tr>
		<th>分组:</th>
		<td>
			<select name="groups" tip="分组查询/修改配置">
				<option value="">不用分组</option>
				<foreach name="Think.config.CONFIG_GROUPS" key="k" item="v">
				<option value="{$k}" <eq name="info.groups" value="$k">selected</eq> >{$v}</option>
				</foreach>
			</select>
		</td>
	</tr>
	<tr>
		<th>模块:</th>
		<td>
			<select name="module" tip="分模块加载配置">
				<foreach name="module" key="k" item="v">
				<option value="{$v}" <eq name="info.module" value="$v">selected</eq> >{$v}</option>
				</foreach>
			</select>
		</td>
	</tr>
	<tr>
		<th>模块:</th>
		<td>
			<input id="is_system_0" type="radio" name="is_system" tip="判定是否可删除" value="0" <eq name="info.is_system" value="0">checked</eq> >
			<label for="is_system_0">模块配置</label>
			<input id="is_system_1" type="radio" name="is_system" value="1" <eq name="info.is_system" value="1">checked</eq> >
			<label for="is_system_1">系统配置</label>
		</td>
	</tr>
	<tr>
		<th>状态:</th>
		<td>
			<input id="status_1" type="radio" name="status" tip="判定是否会加载" value="1" <eq name="info.status" value="1">checked</eq> >
			<label for="status_1">启用</label>
			<input id="status_0" type="radio" name="status" value="0" <eq name="info.status" value="0">checked</eq> >
			<label for="status_0">禁用</label>
		</td>
	</tr>
	<tr>
		<th>排序:</th>
		<td>
			<input type="text" name="sort" tip="分组查询时的排列顺序" value="{$info.sort}">
		</td>
	</tr>
</block>
<block name="extra">
	<script type="text/javascript">
		$('#InputType').change(function(e) {
			if($(this).val()==10){
				$('#InputExtra').show();
			}else{
				$('#InputExtra').hide();
				$('#InputExtra > td > textarea').val('');
			}
		});
	</script>
</block>
